
#include "Base.h"
#include "World.h"
#include "Entities/BaseEntity.h"

namespace CasaEngine
{

/*
 *	
 */
World::World()
{
}

/*
 *	
 */
World::~World()
{
}

const std::vector<BaseEntity *>& World::GetEntities()
{
	return m_Entities;
}

/*
 *	
 */
CellSpace* World::GetSpacePartition() const 
{ 
	return m_pSpacePartition; 
}

/*
 *	
 */
void World::SetSpacePartition(CellSpace* val) 
{ 
	m_pSpacePartition = val; 
}


/*
 *	
 */
CellSpacePartition<BaseEntity*>* World::GetCellSpcEntity() const 
{ 
	return m_pCellSpace; 
}

/*
 *	
 */
void World::SetCellSpcEntity(CellSpacePartition<BaseEntity*>* val) 
{ 
	m_pCellSpace = val; 
}

/**
 *
 */
void World::Update(const GameTime& gameTime_)
{
	for (std::vector<BaseEntity *>::iterator it = m_Entities.begin();
		it != m_Entities.end();
		it++)
	{
		(*it)->Update(gameTime_);
	}
}

void World::AddEntity(BaseEntity* pEntity_)
{
	m_Entities.push_back(pEntity_);
}

} // namespace CasaEngine
